<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head th:replace="dashboard/header :: header"></head>
<body>

<!--
@desc SQL运行 添加
@author WeiXiaoJin
@since 2020-01-26 09:30:11
-->
	<div layout:fragment="content">
		<div class="container-fluid content-main">
			<div class="animated fadeIn">
				<div class="row">
					<!-- /.col-->
					<div class="col-sm-12">
						<div class="card">
							<div class="card-body">
								<form class="form-horizontal" id="addForm">
<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">SQL内容</label>
	<div class="col-md-9">
				<input class="form-control" id="sqlContent" type="text" name="sqlContent" placeholder="SQL内容">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">执行数</label>
	<div class="col-md-9">
				<input class="form-control" id="activeCount" type="text" name="activeCount" placeholder="执行数">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">执行时间</label>
	<div class="col-md-9">
				<input class="form-control" id="activeTime" type="text" name="activeTime" placeholder="执行时间">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">事务中</label>
	<div class="col-md-9">
				<input class="form-control" id="transationCount" type="text" name="transationCount" placeholder="事务中">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">错误数</label>
	<div class="col-md-9">
				<input class="form-control" id="errorCount" type="text" name="errorCount" placeholder="错误数">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">更新数</label>
	<div class="col-md-9">
				<input class="form-control" id="updateCount" type="text" name="updateCount" placeholder="更新数">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">读取行数</label>
	<div class="col-md-9">
				<input class="form-control" id="resultCount" type="text" name="resultCount" placeholder="读取行数">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">并发数</label>
	<div class="col-md-9">
				<input class="form-control" id="threadCount" type="text" name="threadCount" placeholder="并发数">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">最慢</label>
	<div class="col-md-9">
				<input class="form-control" id="maxSlow" type="text" name="maxSlow" placeholder="最慢">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">数据库类型</label>
	<div class="col-md-9">
				<input class="form-control" id="dbType" type="text" name="dbType" placeholder="数据库类型">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">数据库链接</label>
	<div class="col-md-9">
				<input class="form-control" id="dbUrl" type="text" name="dbUrl" placeholder="数据库链接">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">最大运行时间 </label>
	<div class="col-md-9">
				<input class="form-control" id="executeMillisMax" type="text" name="executeMillisMax" placeholder="最大运行时间 ">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">总的时间执行数</label>
	<div class="col-md-9">
				<input class="form-control" id="executeMillisTotal" type="text" name="executeMillisTotal" placeholder="总的时间执行数">
			</div>
</div>
																			</form>
							</div>
						</div>
					</div>
					<!-- /.col-->
				</div>
			</div>
		</div>

	</div>

	<footer th:replace="dashboard/footer :: footer"></footer>

	<script type="text/javascript">
		var addForm = $("#addForm") ; 
		$(function(){
			addForm.validate({
				ignore: [],  
				rules: {
sqlContent: {required:true}
,activeCount: {required:true,number:true}
,activeTime: {required:true,number:true}
,transationCount: {required:true,number:true}
,errorCount: {required:true,number:true}
,updateCount: {required:true,number:true}
,resultCount: {required:true,number:true}
,threadCount: {required:true,number:true}
,maxSlow: {required:true}
,dbType: {required:true}
,dbUrl: {required:true}
,executeMillisMax: {required:true}
,executeMillisTotal: {required:true}
				}
			});
		}) ;

		function submitHandler() {
			var result = $.validate.form("addForm");
			if(result){	
				var saveUrl = ctx+"base/logger/logSql/save" ;
				$.operate.save(saveUrl , addForm.serialize());
			}
	    }
	</script>

</body>
</html>


